package com.chuangke.lowcode.controller;

import com.chuangke.common.db.query.dto.QueryDto;
import com.chuangke.common.http.HttpResult;
import com.chuangke.lowcode.service.SysDictLoadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SysDictLoadController {
	
	@Autowired
	private SysDictLoadService sysDictLoadService;

	@PreAuthorize("hasAuthority('login:action')")
	@PostMapping(value = "/dataservice/load/{dataServiceCode}")
	public HttpResult load(@PathVariable("dataServiceCode") String dataServiceCode,@RequestBody QueryDto queryDto) {
		return HttpResult.ok(sysDictLoadService.loadData(dataServiceCode));
	}

}
